#ifndef __LHWS__
#define __LHWS__

#include <QObject>
#include <QTcpServer>

#include "net_queue.h"

class QTcpSocket;
class QByteArray;

class LHWS : public QObject
{
  Q_OBJECT

public:
  LHWS (short listen_port, short remote_port, int latency, int throughput,
        QObject* parent = 0);

private:
  short _remote_port;
  QTcpServer _server;
  NetQueue _server_queue;
  NetQueue _client_queue;
  QTcpSocket* _server_side;
  QTcpSocket* _client_side;

private slots:
  void new_connection();
  void server_disconnected ();
  void server_data_ready ();
  void server_queue_data_read (const QByteArray& data);
  void client_disconnected ();
  void client_data_ready ();
  void client_queue_data_read (const QByteArray& data);
};

#endif /* __LHWS__ */
